<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:p="http://primefaces.org/ui" 
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

<h:head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</h:head>
<h:body>
 	
	<ui:composition template="template.xhtml">

		<ui:define name="title" />
		<ui:define name="body">
             <c:if test="${sessionScope.currentKullanici.grup != 1}" >
                    <script language="javascript">
                    	alert("bu sayfaya erişim yetkiniz yoktur.")
    					redirectPage();
	  	 			</script>
             </c:if>
			<h:form id="musteriProDuzenleForm" acceptcharset="UTF-8">
				<p:growl id="growl" sticky="true" showDetail="true" />

				<p:wizard widgetVar="wiz" showStepStatus="true" showNavBar="true">

					<p:tab id="personal" title="Personal">

						<p:panel header="Personal Details" id="person">

							<h:messages errorClass="error"
								style="color: red; font-style: italic; text-decoration: blink" />

							<h:panelGrid columns="3" columnClasses="label, value"
								styleClass="grid">
								<h:outputText value="Tc Kimlik: *" />
								<p:inputText label="TcKimlik"
									disabled="true"
									value="#{MusteriBean.currentMusteri.tcKimlik}" style="color:red;">
									<p:ajax event="blur" update="person"
										listener="#{MusteriBean.TcKontrol}" />
									<f:validateLength minimum="11"></f:validateLength>

								</p:inputText>
								<h:outputText id="tcOut" value="#{MusteriBean.tcKontrolText}" />

								<h:outputText value="İsim: *" />
								<p:inputText required="true" label="isim"
									value="#{MusteriBean.currentMusteri.ad}" />
								<h:outputText />

								<h:outputText value="soyisim: *" />
								<p:inputText required="true" label="soyisim"
									value="#{MusteriBean.currentMusteri.soyad}" />
								<h:outputText />

								<h:outputText value="Doğum Tarihi: " />
								<p:inputMask required="true" label="dogumTarihi"
									mask="99/99/9999"
									value="#{MusteriBean.currentMusteri.dogumTarihi}" />
								<h:outputText />

							</h:panelGrid>
						</p:panel>
					</p:tab>

					<p:tab id="address" title="Address">
						<p:panel header="Adress Details">

							<h:messages errorClass="error"
								style="color: red; font-style: italic; text-decoration: blink" />

							<h:panelGrid columns="2" columnClasses="label, value">
								<h:outputText value="il: " />
								<p:inputText value="#{MusteriBean.currentMusteri.adres.il}"
									required="true" requiredMessage="il boş bırakılamaz" />

								<h:outputText value="ilçe: " />
								<p:inputText value="#{MusteriBean.currentMusteri.adres.ilce}"
									required="true" requiredMessage="ilçe boş bırakılamaz" />

								<h:outputText value="Mahalle: " />
								<p:inputText value="#{MusteriBean.currentMusteri.adres.mahalle}"
									required="true" requiredMessage="mahalle boş bırakılamaz" />

								<h:outputText value="Sokak: " />
								<p:inputText value="#{MusteriBean.currentMusteri.adres.sokak}"
									required="true" requiredMessage="Sokak boş bırakılamaz" />

								<h:outputText value="Numara: " />
								<p:inputText value="#{MusteriBean.currentMusteri.adres.numara}"
									required="true" requiredMessage="numara boş bırakılamaz" />

							</h:panelGrid>
						</p:panel>
					</p:tab>

					<p:tab id="contact" title="Contact">
						<p:panel header="Contact Information">

							<h:messages errorClass="error"
								style="color: red; font-style: italic; text-decoration: blink" />

							<h:panelGrid columns="2" columnClasses="label, value">
								<h:outputText value="Email: *" />
								<p:inputText required="true" label="Email"
									value="#{MusteriBean.currentMusteri.email}"
									requiredMessage="e-mail boş bırakılamaz" />

								<h:outputText value="Tel 1: " />
								<p:inputText value="#{MusteriBean.currentMusteri.tel1}"
									required="true" requiredMessage="Tel no boş bırakılamaz" />

								<h:outputText value="Tel 2: " />
								<p:inputText value="#{MusteriBean.currentMusteri.tel2}" />

								<h:outputText value="Fax: " />
								<p:inputText value="#{MusteriBean.currentMusteri.fax}" />

								<h:outputText value="Web Adresi: " />
								<p:inputText value="#{MusteriBean.currentMusteri.kisiselWebAdd}" />
							</h:panelGrid>
						</p:panel>
					</p:tab>

					<p:tab id="kullaniciInfo" title="Login info">
						<p:panel header="Login Information" id="klcInfo">

							<h:messages errorClass="error"
								style="color: red; font-style: italic; text-decoration: blink" />

							<h:panelGrid columns="3" columnClasses="label, value">
								<h:outputText value="Kullanıcı Adı: *" />
								<p:inputText required="true" label="kullaniciAdi"
									value="#{MusteriBean.currentMusteri.kullanici.kullaniciAdi}"
									disabled="true" style="color:red;">
									
								</p:inputText>
								<h:outputText id="klcOut"
									value="Değiştirilemez" />

								<h:outputLabel for="pwd1" value="Password 1: *" />
								<p:password id="pwd1"
									value="#{MusteriBean.currentMusteri.kullanici.parola}"
									feedback="true" promptLabel="Lütfen şifre giriniz"
									weakLabel="Zayıf" goodLabel="Orta seviye" strongLabel="Güçlü"
									match="pwd2" label="Password 1" required="true"
									validatorMessage="Parola tekrarı hatalı" />
								<h:outputText />

								<h:outputLabel for="pwd2" value="Parola tekrar:: *" />
								<p:password id="pwd2"
									value="#{MusteriBean.currentMusteri.kullanici.parola}"
									label="Password 2" required="true" />
								<h:outputText />

							</h:panelGrid>
						</p:panel>
					</p:tab>

					<p:tab id="confirm" title="Confirmation">
						<p:panel header="Confirmation">

							<h:panelGrid id="confirmation" columns="6" rules="all" style="color:red;">
								<h:outputText value="Tc Kimlik: " style="color:red" />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.tcKimlik}" />

								<h:outputText value="Ad: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.ad}" />

								<h:outputText value="Soyad: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.soyad}" />

								<h:outputText value="Doğum Tarihi: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.dogumTarihi}" />

								<h:outputText value="Grup: " />
								<h:outputText styleClass="outputLabel" value="Müşteri" />

								<h:outputText value="İl: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.adres.il}" />

								<h:outputText value="İlçe: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.adres.ilce}" />

								<h:outputText value="Mahalle: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.adres.mahalle}" />

								<h:outputText value="Sokak: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.adres.sokak}" />

								<h:outputText value="Numara " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.adres.numara}" />

								<h:outputText value="Email: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.email}" />

								<h:outputText value="Tel 1: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.tel1}" />

								<h:outputText value="Tel 2: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.tel2}" />

								<h:outputText value="Fax: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.fax}" />

								<h:outputText value="Web Page: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.kisiselWebAdd}" />

								<h:outputText value="Kullanıcı Adı: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.kullanici.kullaniciAdi}" />

								<h:outputText value="Parola: " />
								<h:outputText styleClass="outputLabel"
									value="#{MusteriBean.currentMusteri.kullanici.parola}" />


							</h:panelGrid>

							<p:commandButton value="Kaydet" update="growl"
								actionListener="#{MusteriBean.save}"
								oncomplete="setTimeout('refreshPage();' , 3000);" />

						</p:panel>
					</p:tab>

				</p:wizard>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>